<?php
use yii\helpers\Html;
use yii\helpers\Url;
use app\lib\WeixinUtils;

/* @var $this yii\web\View */
/* @var $content string 字符串 */


$web = Url::to("@web");

?>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>业绩记录</title>
    <link href="<?=$web?>/css/fx/achievement_withdrawals.css?1" rel="stylesheet" type="text/css">
    <link href="<?=$web?>/css/fx/global.css" rel="stylesheet" type="text/css">
    <script src="<?=$web?>/js/jquery.js"></script>
    <script src="<?=$web?>/js/tools.js"></script>
    <script>
        $(function ($) {
            var w = $(document).width();
            if (w > 640) {
                w = 640;
//                console.log(w);
            }
            $("html").css("font-size", w * 20 / 320);

            loadRList();
            $(document).scroll(function () {
                var scrollTop = $(this).scrollTop();
                var scrollHeight = $(window).height();
                var contentHeight = $(this).height();
                // alert(scrollTop+"="+scrollHeight+"="+contentHeight);
                if (scrollTop + scrollHeight >= contentHeight) {
                    // alert(1);
                    loadRList();
                }
            });
        });

        var start = 0;
        var pagesize=12;

        var myResultList_tpl=returnstring('<?=$web?>/js/fx/myResultList.tpl');
        function loadRList() {

            var data = {};
            data.start = start;
            data.pagesize = pagesize;


            var re = returnjson("<?=Url::to(['wx-fx/get-my-result-list-handle'])?>", data);

            if (re.flag == 0) {
                alert(re.msg);
                return;
            } else {
                var target = $(".drawing_board");

                    $.each(re.reList, function (i, item) {
                        var dom = document.createElement("div");
                        dom.innerHTML = myResultList_tpl._format({
                            NICK_NAME:function(){
                                if(item.USER_ID==item.B_USER_ID){
                                    return "我的";
                                }else{
                                   return item.NICK_NAME+'贡献';
                                }
                            },
                            BUY_RESULT: parseFloat(item.BUY_RESULT),
                            CREATE_DATETIME: item.CREATE_DATETIME

                        });
                        target.get(0).appendChild(dom);
                    });

                start = start + re.reList.length;

            }

        }
    </script>
    <style>
        .right_commission{
            margin-right: 0.6rem;
        }
    </style>
</head>
<body style="background-color: #fff">
<div class="drawing_board">

    <!--<div class="head_frame">
        <div class="head_left">
            <div class="left_title"><span>业绩记录</span></div>
            <div class="left_time"><span>2016-02-01&nbsp;17:36</span></div>
        </div>
        <div class="head_right">
            <div class="right_commission"><span>+</span><span>10000</span></div>
        </div>
    </div>-->


</div>
</body>
</html>